package com.ruicar.afs.cloud.product.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author xudongdong
 * @version 1.0
 * @date 2020-05-26
 */
@Data
@TableName("product_update_atom")
@ApiModel(value = "产品修改原子表")
public class ProductUpdateAtom extends BaseEntity<ProductUpdateAtom> {
    @ApiModelProperty(value = "产品方案id")
    @JsonSerialize(using = ToStringSerializer.class)
    @NotBlank(message = "产品方案id不能为空")
    private Long productUpdateId;

    @ApiModelProperty(value = "产品原子id")
    @NotBlank(message = "产品原子id不能为空")
    private Long productAtomId;

    @ApiModelProperty(value = "产品原子key")
    @NotBlank(message = "产品原子key不能为空")
    private String productAtomKey;

    @ApiModelProperty(value = "原子内容")
    private String atomValue;

    public ProductUpdateAtom(long productUpdateId, String productAtomKey, String atomValue) {
        this.productUpdateId = productUpdateId;
        this.productAtomKey = productAtomKey;
        this.atomValue = atomValue;
    }
}
